package controlFlowGraph;

import java.util.HashSet;
import java.util.Set;

public class LabNeg extends CFGLabel {

	private Expression condition;
	
	public LabNeg(Expression cond) {
		this.condition = cond;
	}
	
	@Override
	public Set<Expression> getInvolvedExpressions() {
		Set<Expression> res = new HashSet<Expression>();
		res.add(condition);
		return res;
	}
	
	@Override
	public String toString() {
		return "Neg("+this.condition+")";
	}

	public Expression getCondition() {
		return this.condition;
	}

	public void setCondition(Variable variable) {
		this.condition = variable;
	}
	
	@Override
	public void replaceVariable(Variable v, Constant c){
		this.condition.replaceVariable(v, c);
	}
	
}
